<template>
  <div>
    <input type='file' ref='clearFile'
           @change='getFile($event)' multiple='multiplt'
           class='add-file-right-input'
           style='margin-left:70px;' accept='.docx,.doc,.jpg,.png,.pdf,.aqv,.qsv' />

  </div>
</template>

<script>
export default {
  name: 'fileSpl',
  data() {
    return {}
  },
  methods: {
    getFile(event) {
      console.log('event:', event)
      let file = event.target.files
      console.log('file:', file)
      for (let i = 0; i < file.length; i++) {
        //    上传类型判断
        let imgName = file[i].name
        let idx = imgName.lastIndexOf('.')
        if (idx != -1) {
          let ext = imgName.substr(idx + 1).toUpperCase()
          ext = ext.toLowerCase()
          if (ext != 'pdf' && ext != 'doc' && ext != 'docx') {

          } else {
            this.addArr.push(file[i])
          }
        } else {

        }
      }
    }
  }
}
</script>

